home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Special 17 / AMIGAplus Sonderheft 17 (1999)(ICP)(DE)[!].iso / Rexx / _1_close_mailpacket.rexx < prev    next >
OS/2 REXX Batch file  |  1998-02-17  |  2KB  |  72 lines

  1. /* YAMandPGP V1.0 -- Roberto Ragusa 1997 */
  2. /* close mailpacket */
  3.  
  4. windowfilename = 'CON:50/50/600/200/YAM-REXX/CLOSE'
  5.  
  6. to_be_decrypted_txt = 'to be decrypted and decompressed'
  7.  
  8. userid     = '0x--------'         /* To encrypt mails with your personal key, too, */
  9.                                   /* so you can read sent messages */
  10. pgppath    = 'pgp'
  11.  
  12. pgpcomm_es = '-esa'
  13. pgpcomm_e  = '-ea'
  14.  
  15. CALL CLOSE 'STDOUT'
  16. CALL CLOSE 'STDIN'
  17. CALL OPEN 'STDIN',windowfilename
  18. CALL PRAGMA '*','STDIN'
  19. CALL OPEN 'STDOUT','*'
  20.  
  21. options results
  22.  
  23. address COMMAND
  24.  
  25. call pragma('D','MAILPACKETS:')
  26.  
  27. call pragma('D','newmessage')
  28. 'assign MW: ""'
  29.  
  30. address YAM 'Request "Select the filetype of archived attachment" ".lzx|.lha|.zip|.tar.gz|Cancel"'
  31. choice=result
  32. if choice=1 then do
  33.   'lzx -x -r -e -Qf -M100000 -9 a attachment.lzx attachment'
  34.   attafn="attachment.lzx"
  35.   end
  36. if choice=2 then do
  37.   'lha -x -r -e a attachment.lha attachment'
  38.   attafn="attachment.lha"
  39.   end
  40. if choice=3 then do
  41.   'zip -r -v -9 attachment.zip attachment'
  42.   attafn="attachment.zip"
  43.   end
  44. if choice=4 then do
  45.   'tar -vcf attachment.tar attachment'
  46.   'gzip -v -9 attachment.tar'
  47.   attafn="attachment.tar.gz"
  48.   end
  49. if choice=0 then exit
  50.  
  51. pgppath '>RAM:keys -kv'
  52. 'YAM:Rexx/SelectPGPKey RAM:keys OUTFILE RAM:selected'
  53. address YAM 'Request "Select the operation to be performed" "Encrypt&Sign|Encrypt|Cancel"'
  54. choice=result
  55. if choice=1 then pgpcommand=pgpcomm_es
  56. if choice=2 then pgpcommand=pgpcomm_e
  57. if choice=0 then exit
  58. pgppath pgpcommand attafn userid '-@ram:selected'
  59. 'delete >nil: RAM:keys RAM:selected'
  60.  
  61. address YAM
  62.  
  63. 'Show'
  64. 'MailWrite'
  65. 'WriteSubject ""'
  66. 'WriteMailTo ""'
  67. 'WriteLetter MW:plain_mail.txt'
  68. 'WriteAttach MW:'||attafn||'.asc "'||to_be_decrypted_txt||'" MIME text/plain'
  69.  
  70.  
  71. 'assign MW:'
  72.